package br.com.financas.daos;

import br.com.financas.beans.TipoConta;
import br.com.financas.util.HibernateUtil;
import java.util.List;
import org.hibernate.Criteria;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.criterion.Order;
import org.hibernate.criterion.Restrictions;

/**
 *
 * @author Denis
 */
public class TipoContaDao {
   Session sessao;
   Transaction trans; 
   List<TipoConta>list;
   
   public List<TipoConta> getList(){  
        sessao = HibernateUtil.getSessionFactory().openSession();
        trans=sessao.beginTransaction();
        Criteria cri = sessao.createCriteria(TipoConta.class);
        cri.addOrder(Order.desc("descricao"));
        this.list = cri.list();
        return list;
    }
}